# https://leetcode.cn/problems/apple-redistribution-into-boxes/description/


from typing import List
class Solution:
    def minimumBoxes(self, apple: List[int], capacity: List[int]) -> int:
        capacity.sort()
        s = sum(apple)
        ans = 0
        while s > 0:
            s -= capacity.pop()
            ans += 1
        return ans
